﻿using Microsoft.AspNetCore.Http;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System;
using System.Threading.Tasks;

namespace WebApiExtend.Middleware
{
    /// <summary>
    /// 默认入口管道,可以处理请求头等默认值啥的
    /// </summary>
    public class InitMiddleware : BaseMiddleware
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="next"></param>
        public InitMiddleware(RequestDelegate next) : base(next)
        {
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="httpContext"></param>
        /// <returns></returns>
        public async Task Invoke(HttpContext httpContext)
        {
            //httpContext.Request.Headers.Remove("X-Login-UserID");
            //httpContext.Request.Headers.Remove("X-Login-UserName");
            await this._next.Invoke(httpContext);
        }
    }
}
